package com.four.order.controller;

import com.four.common.utils.R;
import com.four.order.entity.OrCause;
import com.four.order.service.CauseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author lky
 * @version 1.0
 * @date 2022/1/13 9:30
 */
@RestController
@RequestMapping("cause")
public class CauseController {

    @Autowired
    private CauseService causeService;

    @PostMapping("findAll")
    public R findAll(){
        List<OrCause> causes = causeService.findAll();
        return R.ok().put("list",causes);
    }
}
